﻿using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

namespace Phoenix.Xna.Framework.Graphics
{
    public class BlendMap
    {
        private EffectMap _effectMap;
        private Dictionary<string, string> _parameters = new Dictionary<string, string>();

        public Texture2D BlendMapTexture
        {
            get { return _effectMap.GetParameter<Texture2D>(_parameters["BlendTexture"]); }
            set { _effectMap.SetParameter<Texture2D>(_parameters["BlendTexture"], value); }
        }
        public Texture2D Texture1
        {
            get { return _effectMap.GetParameter<Texture2D>(_parameters["Texture1"]); }
            set { _effectMap.SetParameter<Texture2D>(_parameters["Texture1"], value); }
        }
        public Texture2D Texture2
        {
            get { return _effectMap.GetParameter<Texture2D>(_parameters["Texture2"]); }
            set { _effectMap.SetParameter<Texture2D>(_parameters["Texture2"], value); }
        }
        public Texture2D Texture3
        {
            get { return _effectMap.GetParameter<Texture2D>(_parameters["Texture3"]); }
            set { _effectMap.SetParameter<Texture2D>(_parameters["Texture3"], value); }
        }
        public Texture2D Texture4
        {
            get { return _effectMap.GetParameter<Texture2D>(_parameters["Texture4"]); }
            set { _effectMap.SetParameter<Texture2D>(_parameters["Texture4"], value); }
        }

        public BlendMap(EffectMap effectMap, string blendMapParameter, string texture1Parameter, string texture2Parameter, string texture3Parameter, string texture4Parameter)
        {
            _effectMap = effectMap;
            _parameters.Add("BlendTexture", blendMapParameter);
            _parameters.Add("Texture1", texture1Parameter);
            _parameters.Add("Texture2", texture2Parameter);
            _parameters.Add("Texture3", texture3Parameter);
            _parameters.Add("Texture4", texture4Parameter);
        }
    }
}
